﻿using System;
using System.Globalization;
using System.Windows.Data;
using Microsoft.SilverlightMediaFramework.Utilities.Extensions;

namespace JustinAngel.UnitedNationsNews.Pages.Video
{
    public class TimeSpanValueConverter : IValueConverter
    {
        // Methods
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return ((value is TimeSpan) ? ((TimeSpan)value).Format("{1:D2}:{2:D2}") : string.Empty);
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}